﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/OneColumn.Master" AutoEventWireup="true"
    CodeBehind="Edit.aspx.cs" Inherits="SharingCenter.Web.User.Events.Edit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    <asp:Literal ID="Literal1" runat="server">修改活动内容</asp:Literal>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <link href="../../Content/usersettings.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <script src="EventFunc.js" type="text/javascript"></script>

     <myuc:GenericTabs ID="GenericTabs1" runat="server" SelectedItem="edit" Section="MyEvent" />
    <br />
    <h2 class="bb">
        <span class="nss ns-edit"></span>
        <span class="iconlabel">
        修改活动 -
        <%=_event.Title %></span></h2>
    <div>
        <asp:FormView ID="FormView1" runat="server" DefaultMode="Edit" DataKeyNames="EventId"
            DataSourceID="LinqDataSource1" Width="100%">
            <EditItemTemplate>
                <div class="formtable">
                    <fieldset class="ctn1">
                        <legend>主题与报名 </legend>
                        <table cellspacing="0">
                            <tr>
                                <td class="labelcell labelgroup">
                                    活动主题:
                                </td>
                                <td class="inputgroup">
                                    <asp:TextBox ID="TitleTextBox" runat="server" Text='<%#Bind("Title") %>' />
                                    <asp:RequiredFieldValidator ValidationGroup="event" ID="RequiredFieldValidator1"
                                        runat="server" ErrorMessage="活动主题必须填写。" SetFocusOnError="true" ControlToValidate="TitleTextBox"
                                        Display="None" />
                                    <cc:CustomValidatorCallOut ID="ValidatorCalloutExtender1" runat="server" TargetControlID="RequiredFieldValidator1" />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                    活动类型:
                                </td>
                                <td>
                                    <cc:XmlDropDownList runat="server" XmlPath="~/App_Data/ActivityCategories.xml" ID="XmlDropDownList1"
                                        SelectedValue='<%# Bind("Category") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell" valign="top">
                                    活动时间:
                                </td>
                                <td>
                                <div class="ctn-p-b">
                                    <asp:RequiredFieldValidator ValidationGroup="event" ID="RequiredFieldValidator2"
                                        runat="server" ErrorMessage="必须选择开始日期。" SetFocusOnError="true" ControlToValidate="txtStartDate"
                                        Display="None" />
                                    <cc:CustomValidatorCallOut ID="CustomValidatorCallOut1" runat="server" TargetControlID="RequiredFieldValidator2"
                                        PopupPosition="Left" />
                                    <asp:CustomValidator ValidationGroup="event" ControlToValidate="txtStartDate" ClientValidationFunction="CheckStartDate"
                                        SetFocusOnError="true" Display="None" ID="CustomValidator3" runat="server" ErrorMessage="活动开始时间不能早于现在。" />
                                    <cc:CustomValidatorCallOut ID="CustomValidatorCallOut6" runat="server" TargetControlID="CustomValidator3"
                                        PopupPosition="Left" />
                                    <ajaxctrltool:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server"
                                        TargetControlID="txtStartDate" WatermarkCssClass=" tb-m textboxwatermark"
                                        WatermarkText="开始日期">
                                    </ajaxctrltool:TextBoxWatermarkExtender>
                                    <%--<ajaxctrltool:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtStartDate">
                                    </ajaxctrltool:CalendarExtender>--%>
                                    <asp:TextBox ID="txtStartDate" runat="server" Text='<%#Eval("StartDate", "{0:yyyy-MM-dd}") %>'
                                        CssClass="tb-m  startdate"></asp:TextBox>
                                    <cc:NumericDropDownList CssClass="starthour" ID="nddStartHours" runat="server" LowerBound="0"
                                        UpperBound="23" IsYearList="false" SelectedValue='<%#Convert.ToDateTime(Eval("StartDate")).Hour %>' />
                                    <span>点</span>
                                    <cc:NumericDropDownList CssClass="startmin" ID="nddStartMins" runat="server" LowerBound="0"
                                        UpperBound="59" IsYearList="false" SelectedValue='<%#Convert.ToDateTime(Eval("StartDate")).Minute %>' />
                                    <span>分 至</span></div>
                                    <div>
                                    <asp:RequiredFieldValidator ValidationGroup="event" ID="RequiredFieldValidator3"
                                        runat="server" ErrorMessage="必须选择结束日期。" SetFocusOnError="true" ControlToValidate="txtEndDate"
                                        Display="None" />
                                    <cc:CustomValidatorCallOut ID="CustomValidatorCallOut2" runat="server" TargetControlID="RequiredFieldValidator3"
                                        PopupPosition="Left" />
                                    <ajaxctrltool:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender2" runat="server"
                                        TargetControlID="txtEndDate" WatermarkCssClass="tb-m textboxwatermark"
                                        WatermarkText="结束日期">
                                    </ajaxctrltool:TextBoxWatermarkExtender>
                                   <%-- <ajaxctrltool:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtEndDate">
                                    </ajaxctrltool:CalendarExtender>--%>
                                    <asp:TextBox ID="txtEndDate" runat="server" CssClass="tb-m enddate" Text='<%#Eval("EndDate", "{0:yyyy-MM-dd}") %>'></asp:TextBox>
                                    <cc:NumericDropDownList CssClass="endhour" ID="nddEndHours" runat="server" LowerBound="0"
                                        UpperBound="23" IsYearList="false" SelectedValue='<%#Convert.ToDateTime(Eval("EndDate")).Hour %>' />
                                    <span>点</span>
                                    <cc:NumericDropDownList CssClass="endmin" ID="nddEndMins" runat="server" LowerBound="0"
                                        UpperBound="59" IsYearList="false" SelectedValue='<%#Convert.ToDateTime(Eval("EndDate")).Minute %>' />
                                    <asp:CustomValidator ValidationGroup="event" ControlToValidate="txtEndDate" ClientValidationFunction="CheckActivityDates"
                                        SetFocusOnError="true" Display="None" ID="CustomValidator1" runat="server" ErrorMessage="结束时间不能早于开始时间。" />
                                    <cc:CustomValidatorCallOut ID="CustomValidatorCallOut3" runat="server" TargetControlID="CustomValidator1"
                                        PopupPosition="Left" /></div>
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                    报名截至:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtSignUpCloseDate" runat="server" CssClass="tb-m offdate"
                                        Text='<%#Eval("SignUpCloseDate", "{0:yyyy-MM-dd}") %>'></asp:TextBox>
                                    <asp:RequiredFieldValidator ValidationGroup="event" ID="RequiredFieldValidator4"
                                        runat="server" ErrorMessage="必须选择报名截止时间。" SetFocusOnError="true" ControlToValidate="txtSignUpCloseDate"
                                        Display="None" />
                                    <cc:CustomValidatorCallOut ID="CustomValidatorCallOut5" runat="server" TargetControlID="RequiredFieldValidator4"
                                        PopupPosition="Left" />
                                    <ajaxctrltool:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender3" runat="server"
                                        TargetControlID="txtSignUpCloseDate" WatermarkCssClass=" tb-m textboxwatermark"
                                        WatermarkText="报名截止日">
                                    </ajaxctrltool:TextBoxWatermarkExtender>
                                   <%-- <ajaxctrltool:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtSignUpCloseDate">
                                    </ajaxctrltool:CalendarExtender>--%>
                                    <cc:NumericDropDownList ID="nddSignUpCloseHours" CssClass="offhour" runat="server"
                                        SelectedValue='<%#Convert.ToDateTime(Eval("SignUpCloseDate")).Hour %>' LowerBound="0"
                                        UpperBound="23" IsYearList="false" />
                                    点
                                    <asp:CustomValidator ValidationGroup="event" ControlToValidate="txtSignUpCloseDate"
                                        ClientValidationFunction="CheckSignUpDates" SetFocusOnError="true" Display="None"
                                        ID="CustomValidator2" runat="server" ErrorMessage="报名截止时间不能晚于开始时间。" />
                                    <cc:CustomValidatorCallOut ID="CustomValidatorCallOut4" runat="server" TargetControlID="CustomValidator2"
                                        PopupPosition="Left" />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                </td>
                                <td>
                                    <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%#Bind("NeedApproval") %>'
                                        Text="报名需我批准" />
                                </td>
                            </tr>
                            <%--<tr>
                            <td class="labelcell">我自己先报名:</td>
                            <td >
                                <asp:CheckBox ID="chkCreatorSignUp" runat="server" Checked="true" />
                            </td>
                        </tr>--%>
                            <tr>
                                <td class="labelcell">
                                    人数限制:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox1" runat="server" CssClass="tb-s" Text='<%# Bind("MaxParticipants") %>'></asp:TextBox>
                                    人
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                    <fieldset class="ctn1">
                        <legend>地点与费用</legend>
                        <table cellspacing="0">
                            <tr>
                                <td class="labelcell">
                                    所在地区:
                                </td>
                                <td>
                                    <asp:TextBox ID="PlaceTextBox" runat="server" Text='<%# Bind("Place") %>' />
                                    <asp:RequiredFieldValidator ValidationGroup="event" ID="RequiredFieldValidator5"
                                        runat="server" ErrorMessage="所在地区必须填写。" SetFocusOnError="true" ControlToValidate="PlaceTextBox"
                                        Display="None" />
                                    <cc:CustomValidatorCallOut ID="CustomValidatorCallOut7" runat="server" TargetControlID="RequiredFieldValidator5" />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                    具体地点:
                                </td>
                                <td class="inputgroup">
                                    <asp:TextBox ID="VenueTextBox" runat="server" Text='<%# Bind("Venue") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                    费用说明:
                                </td>
                                <td class="inputgroup">
                                    <asp:TextBox ID="FeeTextBox" runat="server" Text='<%# Bind("Fee") %>' />
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                    <fieldset class="ctn1">
                        <legend>联系方式</legend>
                        <table cellspacing="0">
                           <%-- <tr>
                                <td colspan='2'>
                                    <h2 class="s1">
                                        <img src="../../Content/images/icons/edit_16.png" alt="" />
                                        联系人</h2>
                                </td>
                            </tr>--%>
                            <tr>
                                <td class="labelcell">
                                    联系人:
                                </td>
                                <td class="inputgroup">
                                    <asp:TextBox ID="ContactPersonTextBox" runat="server" Text='<%# Bind("ContactPerson") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                    联系电话:
                                </td>
                                <td class="inputgroup">
                                    <asp:TextBox ID="ContactPhoneTextBox" runat="server" Text='<%# Bind("ContactPhone") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                    联系E-mail:
                                </td>
                                <td class="inputgroup">
                                    <asp:TextBox ID="ContactEmailTextBox" runat="server" Text='<%# Bind("ContactEmail") %>' />
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                    <fieldset class="ctn1">
                        <legend>其他信息</legend>
                        <table cellspacing="0">
                            <tr>
                                <td class="labelcell" style="vertical-align: top">
                                    活动介绍:
                                </td>
                                <td class="inputgroup htmleditor">
                                        <myuc:Editor runat="server" Height="300" Width="700" EditorType="Advanced" Content='<%# Bind("Description") %>' ID="AdvancedEditor1" />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                    权限等级：
                                </td>
                                <td>
                                    <cc:PrivacyDropDownList ID="PrivacyDropDownList1" runat="server" Privacy='<%# Bind("Privacy") %>'
                                        HideNobodyOption="true" />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                    修改完成：
                                </td>
                                <td>
                                    <asp:RadioButtonList runat="server" ID="rdoPostEditAction" RepeatDirection="Horizontal"
                                        RepeatLayout="Flow">
                                        <asp:ListItem Text="停留在本页面" Value="1" />
                                        <asp:ListItem Text="回到我的活动" Value="2" Selected="True" />
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </div>
                <div class="actionarea">
                    <asp:LinkButton ValidationGroup="event" ID="btnUpdate" CommandName="Update" runat="server"
                        Text="确定" CssClass="submitbutton" />
                    <a href="javascript:" onclick="ConfirmCancelEdit()" class="cancelbutton">取消</a>
                </div>
            </EditItemTemplate>
        </asp:FormView>
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="SharingCenter.Web.Classes.scDataContext"
            TableName="Sc_Events" EnableUpdate="true">
        </asp:LinqDataSource>
    </div>
</asp:Content>
